/* This is the entry of the kernel. 
 * Allocate kernel stack and jump to "main.c".
 */
    .global kentry
    .global kstack
    .global kstack_top

    .section .text
kentry:
    # allocate kernel stack
    la sp, kstack_top
    # jump to main() in main.c
    call main
    
    .section .data
    # 2^12 = 4096 = PGSIZE
    .align 12
kstack:
    # allocate 2 pages for kernel stack
    .space 4096 * 2
kstack_top:
